<?php


namespace plugin\colewechat\app\admin\controller;


use app\common\controller\BaseAdminController;
use plugin\colewechat\app\admin\logic\WechatReplyLogic;

class ReplyController extends BaseAdminController
{
    protected function init()
    {
        parent::init();
        $this->logic = new WechatReplyLogic();
    }

    public function list()
    {
        $where = [
            ['status', '<>', -1]
        ];
        $this->form['name'] && $where[] = ['name', 'like', "%" . $this->form['username'] . "%"];
        $this->form['reply_type'] && $where[] = ['reply_type', '=', $this->form['reply_type']];
        $data = $this->logic->getPageList($this->logic->search($where));
        return $this->success($data);
    }


}